package leetcode;

import java.util.ArrayList;
import java.util.List;

public class l0448_找到所有数组中消失的数字 {
    public List<Integer> findDisappearedNumbers(int[] nums) {
        List<Integer> resultList = new ArrayList<>();
        if (nums == null || nums.length == 0) {
            return resultList;
        }
        int[] dataArray = new int[nums.length + 1];
        for (int num : nums) {
            dataArray[num]++;
        }
        // [1,n] 范围
        for (int i = 1; i < dataArray.length; i++) {
            if (dataArray[i] == 0) {
                resultList.add(i);
            }
        }
        return resultList;
    }

}

